package org.jeecg.modules.reportLabel.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.reportLabel.entity.ReportLabel;
import org.jeecg.modules.reportLabel.mapper.ReportLabelMapper;
import org.jeecg.modules.reportLabel.service.IReportLabelService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 标签统计报表
 * @Author: jeecg-boot
 * @Date: 2023-12-01
 * @Version: V1.0
 */
@Service
public class ReportLabelServiceImpl extends ServiceImpl<ReportLabelMapper, ReportLabel> implements IReportLabelService {

    @Override
    public int countByCode(String code) {
        LambdaQueryWrapper<ReportLabel> wrapper = Wrappers.lambdaQuery();
//        wrapper.eq(ReportLabel::getBarCode, code);
        return baseMapper.selectCount(wrapper);
    }

    @Override
    public ReportLabel getOneForUpdate(String originalLabelNumber) {
        return this.baseMapper.getOneForUpdate(originalLabelNumber);
    }

    @Override
    public List<String> listBySkuCode(LambdaQueryWrapper<ReportLabel> reportLabelLambdaQueryWrapper) {
        return this.baseMapper.listBySkuCode(reportLabelLambdaQueryWrapper);
    }

    @Override
    public IPage<ReportLabel> inventoryPage(Page<ReportLabel> page, QueryWrapper<ReportLabel> queryWrapper) {
        return this.baseMapper.inventoryPage(page, queryWrapper);
    }

    @Override
    public List<ReportLabel> inventoryList(QueryWrapper<ReportLabel> queryWrapper) {
        return this.baseMapper.inventoryList(queryWrapper);
    }

    @Override
    public List<ReportLabel> getBasicShelfReportLabel(QueryWrapper<ReportLabel> queryWrapper) {
        return this.baseMapper.getBasicShelfReportLabel(queryWrapper);
    }

}
